<?php use_helper('Javascript') ?>
<?php $name = 'com_localidad' ?>
  <div class="<?php echo 'sf_admin_form_row sf_admin_text sf_admin_form_field_com_localidad' ?><?php $form[$name]->hasError() and print ' errors' ?>">
    <?php echo $form[$name]->renderError() ?>
    <div>
      <?php echo $form[$name]->renderLabel('Localidad') ?>

      <div class="content"><?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?></div>

      <?php //if ($help): ?>
        <!--div class="help"><?php //echo __($help, array(), 'messages') ?></div-->
      <?php //elseif ($help = $form['cli_localidad']->renderHelp()): ?>
        <div class="help"><?php //echo $help ?></div>
      <?php //endif; ?>
    </div>
  </div>


<?php echo javascript_tag(
  remote_function(array(
    'update'  => 'comercios_com_provincia',
    'url'     => 'clientes/obtenerProvincia',
    'method'   => 'get',
    'with'     => "'loc_id=' + \$F('comercios_com_localidad')",
  ))
) ?>


<?php echo observe_field(
        'comercios_com_provincia',
        array(
            'update'   => 'comercios_com_localidad',
            'url'      => 'clientes/localidadesPorProvincia',
            'method'   => 'get',
            'with'     => "'pcia_id=' + \$F('comercios_com_provincia') + '&loc_id=' + \$F('comercios_com_localidad')",
)) ?>

<?php /*echo javascript_tag(
  remote_function(array(
    'update'  => 'comercios_com_localidad',
    'url'     => 'clientes/localidadesPorProvincia',
    'method'   => 'get',
    'with'     => "'pcia_id=' + \$F('comercios_com_provincia') + '&loc_id=' + \$F('comercios_com_localidad')",
  ))
)*/ ?>

